html, body {
    height: 100%;
    font-size: 15px;
    color: #000;
}
*::-webkit-scrollbar {
    width: 0;
}

input, textarea {
    outline: none;
    resize: none;
}

.container-fluid {
    padding: 0;
    font-size: 1rem;
}

@font-face {
    font-family: 'iconfont';  /* Project id 4079339 */
    src: url('//at.alicdn.com/t/c/font_4079339_fxe2tzlj2kj.woff2?t=1699003293126') format('woff2'),
    url('//at.alicdn.com/t/c/font_4079339_fxe2tzlj2kj.woff?t=1699003293126') format('woff'),
    url('//at.alicdn.com/t/c/font_4079339_fxe2tzlj2kj.ttf?t=1699003293126') format('truetype');
}

.icon {
    font-family: iconfont;
}

.iconfont {
    font-family: iconfont;
    cursor: pointer;
    border-radius: .5rem;
    padding: 0 0.4rem;
}

.iconfont-bg:active, .iconfont-bg:hover, .iconfont-bg.selected {
    color: #209d44;
    background-color: #eee;
}

.slide-in {
    animation: slideInFromRight 0.1s ease-in-out;
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(0);
    }
}

.slide-out {
    animation: slideOutToRight 0.1s ease-in-out;
}

@keyframes slideOutToRight {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

.slide-up {
    animation: slideUp 0.1s forwards;
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(100%);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.fade-out {
    animation: fadeOut 2s forwards;
}

.iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.small-window {
    max-width: 1140px;
    max-height: 895px;
    border: 1px solid #dee2e6 !important;
    border-radius: .5rem;
    position: relative;
}

.left-bar {
    width: 70px;
    height: 100%;
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
    font-family: iconfont;
}

.left-bar .iconfont {
    font-size: 25px;
    color: #888;
}

.left-bar>div:last-child {
    margin-top: auto !important;
}

.left-bar .iconfont.selected {
    color: #209d44;
}

.left-bar img {
    width: 40px;
    height: 40px;
}

.send-btn {
    position: absolute;
    right: .5rem;
    bottom: .5rem;
    margin: 0;
}

.icp {
    position: absolute;
    left: .8rem;
    bottom: .5rem;
    margin: 0;
    font-size: 12px;
}

a.icp {
    color: #ccc !important;
    text-decoration: none;
}

.add-btn {
    height: 1.95rem !important;
    width: 2.2rem !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-tools-item {
    font-size: 1.38rem;
    cursor: pointer;
    color: #666;
    display: inline-block;
    margin: .5rem 1rem;
    padding: 0 .2rem !important;
}

[v-cloak] {
    display: none !important;
}

.params-box, .api-key-box {
    position: absolute;
    bottom: 200px;
    background-color: #fff;
    padding: 1rem;
    border-radius: .5rem;
    max-width: 100%;
    width: 450px;
}

.center-div {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.center-box {
    position: absolute;
    width: 400px;
    background-color: #fff;
    border-radius: .5rem;
    top: 50%;
    left: 50%;
    margin-left: -200px;
    margin-top: -250px;
    padding: 2rem;
    max-width: 100%;
}

.more-box {
    position: absolute;
    bottom: 20px;
    left: 66px;
    background-color: #fff;
    width: 200px;
    border: 1px solid #eee;
}

.right-box {
    position: absolute;
    width: 375px;
    max-width:85%;
    right: 0;
    top: 0;
    bottom: 0
}

.send-method-box {
    position: absolute;
    bottom: 200px;
    right: 0;
    background-color: #fff;
    padding: 0.6rem;
    border-radius: .5rem;
    cursor: pointer;
    max-width: 100%;
}

.dropdown-item {
    padding: .25rem 1rem .25rem 1rem;
}

.dropdown-item:active {
    background-color: #e9ecef;
    color: #209d44;
}

.dropdown-item.selected::before {
    content: "✓";
}

.chat-bar {
    height: 100%;
    border-right:1px solid #ddd;
    width: 250px;
    flex-shrink: 0;
}
.chat-list {
    height: calc(100% - 60px);
    overflow-y: scroll;
    overflow-x: hidden;
    padding-bottom: 1rem;
}
.chat-list .item {
    padding: 0.6rem 0.8rem;
    display: flex;
    justify-content: space-between;
    -webkit-user-select: none !important;
    user-select: none !important;
    transition: background-color 0.3s ease;
}

.chat-list .item:hover {
    background: #f2f3f5;
}

.chat-list .selected {
    background-color: #f2f3f5;
}

.shadow-selected {
    box-shadow: 1px 1px 10px #ddd;
}

.chat-list .desc {
    color: #6c757d;
    font-size: 0.86rem;
    max-width: 150px;
}

.chat-box {
    height: 100%;
    width: calc(100% - 250px);
}

.page-box {
    border-end-end-radius: .5rem;
}

.chat-box .header, .page-box .header {
    height: 60px;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    padding: 0 1rem;
    border-bottom: 1px solid #ddd;
}

.page-box .body {
    height: calc(100% - 60px);
    background-color: #f2f3f5;
    position: relative;
    border-end-end-radius: .5rem;
    overflow: hidden;
}

.chat-box .body {
    height: calc(100% - 260px);
    background-color: #f2f3f5;
    position: relative;
}

.message-list {
    padding: 0 1rem;
}

.message-list li.d-flex:first-child {
    margin-top: 2rem !important;
}

.message-list>li:last-child {
    margin-bottom: 2.5rem;
}

.chat-box .body .stop-btn {
    position: absolute;
    bottom: .25rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
}

.chat-box .footer {
    height: 200px;
    border-top: 1px solid #ddd;
    overflow: hidden;
    position: relative;
}

.chat-box .footer .tools {
    height: 50px;
    user-select: none;
}

.chat-box .footer textarea {
    width: 100%;
    padding: 0 1rem;
    border: 0;
}

.btn-primary-light {
    background-color: #3c9aff !important;
}

.voice-btn {
    height: 4rem;
    width: 4rem;
}

.f28 {
    font-size: 28px;
}

.f23 {
    font-size: 1.53rem;
}

.f20 {
    font-size: 1.33rem;
}

.f18 {
    font-size: 1.2rem;
}

.f12 {
    font-size: 0.8rem;
}

.f13 {
    font-size: 0.9rem;
}

.f15 {
    font-size: 1rem;
}

.f16 {
    font-size: 1.07rem;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-default {
    cursor: default;
}

.avatar {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 3rem;
    background-color: #ddd;
}

.custom-switch-green.custom-control-input:checked~.custom-control-label::before {
    background-color: #28a745;
    border-color: #28a745;
}

.custom-switch-green.custom-control-input:checked~.custom-control-label::after {
    background-color: #fff;
}

.custom-switch-green.custom-control-input:focus~.custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.custom-switch-green.custom-control-input:disabled:checked~.custom-control-label::before {
    background-color: rgba(40, 167, 69, 0.5);
}

.custom-switch-green.custom-control-input:disabled~.custom-control-label {
    color: rgba(40, 167, 69, 0.5);
}

/* 拷贝 */
.block-copy, .block-copy:before, .block-copy:hover, .block-copy:active:before {
    content: '\e711';
    cursor: pointer;
    border-radius: .5rem;
    padding: .25rem .15rem;
}
.block-copy:hover {
    background-color: #eee;
}
.block-copy:active:before {
    background-color: #eee;
    content: '\e742';
}

.message-body img {
    max-width: 512px;
    height: auto;
    border-radius: .5rem;
}

.image-tools {
    max-width: 512px;
    margin-top: 8px;
}

.image-tools .btn {
    min-width: 65px;
    background-color: #6f7d8a;
    border-color: #606972;
    color: #fff;
}

.image-tools .btn.focus, .image-tools .btn:focus, .image-tools .btn:hover, .image-tools .btn.selected {
    background-color: #1d3145;
    border-color: #555f66;
}

.markdown-body {
    overflow-wrap: anywhere !important;
    font-size: 15px !important;
}

.markdown-body table {
    width: auto !important;
}

.markdown-body>p>img {
    margin-top: .25rem;
    margin-bottom: .25rem;
    border-radius: .25rem;
    max-width: 512px;
    max-height: 512px;
}

.markdown-body pre>code {
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
}

/* 消息 */
.message-list .alert {
    padding: .5rem .75rem;
    color: #000 !important;
    min-height: 2.5rem;
}

.message-list .alert-secondary {
    background-color: #ededed;
}

/* 闪烁的光标 */
.animate-blink {
    animation: blink 1.2s infinite steps(1,start);
}
@keyframes blink {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}


/* loading 动画 */
.loading, .img-loading {
    display: flex;
    justify-content: center;
    align-items: center;
}
.img-loading {
    max-width: 512px;
    max-height: 512px;
    background-color: #fff;
    border-radius: .5rem;
    width: 512px;
    aspect-ratio: 1/1;
}
.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ddd;
    margin: 0 5px;
    opacity: 0.3;
    animation: pulse 0.5s ease-in-out infinite alternate;
}
.dot1 {
    animation-delay: 0s;
}
.dot2 {
    animation-delay: 0.2s;
}
.dot3 {
    animation-delay: 0.4s;
}
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.5);
        opacity: 1;
    }
}


/* 图片预览浮层 */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.overlay>img {
    max-width: 95%;
    max-height: 95%;
}
.overlay .close {
    position: absolute;
    top: 0.67rem;
    right: 0.67rem;
    color: #fff;
    cursor: pointer;
}
/* end */

/* 手机适配 */
@media (max-width: 768px) {
    .left-bar {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        padding-top: 0;
        height: 3.2rem;
        flex-shrink: 0;
        border-top: 1px solid #ccc;
        background-color: #fff;
        z-index:1001;
    }
    .chat-bar {
        width: 100%;
        height: calc(100% - 3.2rem);
    }
    .left-bar .iconfont {
        margin-left: 1.8rem;
        margin-right: 1.8rem;
    }
    .avatar {
        width: 3rem;
        height: 3rem;
        border-radius: 3rem;
        background-color: #ddd;
    }
    .chat-list .desc {
        max-width: 70vw;
    }
    .message-list {
        padding: 0 .5rem;
    }
    .image-tools .btn {
        min-width: 50px;
    }
    .center-box, .params-box, .api-key-box {
        width: 96% !important;
        margin:0;
        left: initial !important;
        top: initial !important;
    }
    .center-box {
        position: relative;
    }
    .params-box, .api-key-box {
        bottom: 120px;
    }
    .chat-box .header {
        height: 50px;
    }
    .chat-box .footer {
        height: 120px;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
    }
    .chat-box .body {
        height: calc(100% - 50px - 120px);
    }
    .more-box {
        width: 100%;
    }
    .chat-box .avatar {
        width: 2.5rem;
        height: 2.5rem;
    }
    .chat-list {
        height: calc(100% - 64px);
    }
    .chat-list-footer {
        display: none;
    }
    .markdown-body {
        font-size: 1rem !important;
    }
    .message-body img {
        max-width: 70vw !important;
    }
    .img-loading {
        width: 77vw;
    }
    .voice-btn {
        height: 2rem;
        width: 2rem;
        font-size: 1rem !important;
    }
    html, body {
        height: 100%;
        font-size: 17px;
    }
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}